<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>
<table class="table">
    <thead>
    <tr>
        <th scope="col"><input type="checkbox" class="check_all"></th>
        <th scope="col">商品名称</th>
        <th scope="col">价格</th>
    </tr>
    </thead>
    <tbody>
    {volist name="cart" id="v"}
    <tr>
        <th scope="row"><input type="checkbox" class="row_check"></th>
        <td>{$v.goods_name}</td>
        <td>数量为:<span style="color: red">{$v.price}</span></td>
        <td>{$v.number}</td>
    </tr>
    {/volist}
    </tbody>
</table>
</body>
</html>
<script>
    $(".check_all").on('click',function () {
        var status = $(this).prop('checked');
        $(".row_check").prop('checked',status);
    })
</script>